/********************************************************************************
 * Project Name		[JavaEE_Web]
 * File Name     	[OtherwiseTag.java]
 * Creation Date 	[2015-01-01]
 * 
 * Copyright© ge.y.yang@gmail.com All Rights Reserved
 * 
 * Work hard, play harder, think big and keep fit
 ********************************************************************************/
package jsp.tag.cases;

import java.io.IOException;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.SimpleTagSupport;

/**
 * @author 不落的太阳(Sean Yang aka ShortPeace)
 * @version 1.0
 * @since jdk 1.8
 * 
 */
public class OtherwiseTag extends SimpleTagSupport {

	@Override
	public void doTag() throws JspException, IOException {
		ChooseTag chooseTag = (ChooseTag) this.getParent();
		if (chooseTag.isFlag()) {
			this.getJspBody().invoke(null);
			chooseTag.setFlag(false);
		}
	}
}
